//
//  RightItemView.m
//  PropertyMananger
//
//  Created by bh on 17/4/8.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "RightItemView.h"

@implementation RightItemView

- (instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    
    if (self) {
        
         UIView * bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 44)];
        
        [self addSubview:bgView];
        
        self.selectedTimeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [bgView addSubview:self.selectedTimeBtn];
        [self.selectedTimeBtn setImage:IMG(@"ico_statistics_month_white") forState:UIControlStateNormal];
        
        [self.selectedTimeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(bgView).with.offset(0);
            make.centerY.equalTo(bgView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(32, 32));
        }];
        
        self.timeLabel = [[UILabel alloc]init];
        [bgView addSubview:self.timeLabel];
        
        self.timeLabel.textColor = [UIColor whiteColor];
        self.timeLabel.font = BHFont(15);
        self.timeLabel.textAlignment= NSTextAlignmentRight;
        
        [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(bgView).offset(5);
            make.centerY.equalTo(bgView).with.offset(0);
            make.height.mas_equalTo(25);
        }];

    }
    
    return self;
}

@end
